package com.boyi.center.controller;


import com.boyi.shared.common.Page;
import com.boyi.shared.common.Result;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author Yan Peixuan
 * @date 2017/3/28 21:06
 * @description
 */
public interface BaseController<T> {
    //    Result<List<T>> selectByPrimaryKey(Object key);
	Result<List<T>> save(@RequestBody T entity);

	Result<List<T>> batchInsert(@RequestBody List<T> entities);

	Result<List<T>> delete(@RequestBody T entity);

    //    Result<List<T>> updateByPrimaryKey(T entity);
	Result<List<T>> updateNotNull(@RequestBody T entity);

//    List<T> selectByExample(Object example);


    @GetMapping
	Result<List<T>> selectPage(T entity, Page page);

    @DeleteMapping("batchDelete")
	Result<List<T>> batchDelete(@RequestBody String[] ids);
}
